package com.le.tester;

import com.le.tester.utils.IPUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;


@SpringBootApplication
@EnableCaching
@EnableScheduling
@MapperScan("com.le.tester.dao")
@EnableSwagger2
public class Application {

    private static final Logger LOG = LoggerFactory.getLogger(Application.class);

    public static void main(String[] args) {

        SpringApplication app = new SpringApplication(Application.class);
        Environment environment = app.run(args).getEnvironment();
        LOG.info("启动成功！");
        LOG.info("Application启动地址：{}，端口：{}", IPUtil.getLocalIP(), environment.getProperty("server.port"));
    }

}
